﻿using System.Text;
using TianYu.Core.Common;
using TianYu.Core.Pdf; 

namespace Microsoft.Extensions.DependencyInjection
{
    public static class PdfTemplateServiceCollectionExtensions
    {
        public static IServiceCollection AddPDF(this IServiceCollection services)
        {
            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
            services.Configure<PdfTemplateOptions>(AppsettingsHelper.Section("PDFDocument"));
            services.AddSingleton<IPdfDocumentService, PdfDocumentService>();
            return services;
        }
    }
}
